Skip to content

Account for the viewport size in image preview #6033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

akatsoulas
Copy link
Collaborator

  • Close modal on Esc
  • Close modal on clickOut

Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing something strange when I test this locally. When I click on an uploaded -- but not yet submitted -- image to preview it, I get two image modals, one on top of the other. So, for example, when I click on an uploaded image for preview I see this:

image image

and when I close that image, I see that there's another of the same image below it, but it's a bit narrower:

image

After the image has been submitted as part of the question, and I click on the image to preview it, I don't see that behavior:

image image

Two more minor things:

  • The close (X) button is barely visible for me, although I can reach it.
  • When I click on the esc key, it not only closes the image, but also takes my browser window out of full-screen mode. Is that because we're not stopping the propagation of that event after closing the image modal?

* Close modal on Esc
* Close modal on clickOut
@akatsoulas akatsoulas force-pushed the fix-preview-modal branch from 29832a3 to 72288d6 Compare June 3, 2024 10:56
@akatsoulas
Copy link
Collaborator Author

The X button should be visible now. I wasn't able though to replicate any of the issues you mentioned earlier. Could you maybe do a fresh build and then run make init and npm run webpack:build?

Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akatsoulas The X button placement looks great now. However, even after doing a make clean, make init, and an extra npm run webpack:build I still see two image modals initially when previewing. This is definitely an improvement though, and my issue may be just something on my end, so I'm approving this.

@akatsoulas akatsoulas merged commit 902cab5 into mozilla:main Jun 4, 2024
2 checks passed
@akatsoulas akatsoulas deleted the fix-preview-modal branch June 4, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants